﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace Exam.Filters
{
    public class BaseAttribute: ActionFilterAttribute
    {
        public string GetIp()
        {
            // return "127.0.0.1";//正式环境请注释  localhost  127.0.0.1  :::1
            IHttpContextAccessor _httpContextAccessor = new HttpContextAccessor();
            return _httpContextAccessor.HttpContext.Connection.RemoteIpAddress.ToString();//测试环境请注释
        }
    }
}
